package FourHomeworkDesign.Flyweight;

import java.util.ArrayList;

/**
 * @author 北巷_东坡
 * @date 2022/11/13 19:23
 * @computer 10741
 */
public class WordFactory206 {
    private ArrayList<String> list = new ArrayList<String>();
    private ArrayList<Word206> Word206List = new ArrayList<Word206>();

    public Word206 getWord206(String str) {
        if(list.contains(str) == false) {
            list.add(str);
        }
        Word206 Word206 = new Word206(str);
        Word206List.add(Word206);
        return Word206;
    }

    //批量设置颜色
    public void setColor(Color206 color) {
        for(Word206 Word206 : Word206List) {
            Word206.setColor(color);
        }
    }
    //批量设置字体
    public void setFont206(Font206 Font206) {
        for(Word206 Word206 : Word206List) {
            Word206.setFont(Font206);
        }
    }
}
